/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sudoku;

import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.logging.Level;
import java.util.logging.Logger;
import Modelo.TableroInicial9x9;
import Modelo.SolucionTablero9x9;

public class IniciarNivel9x9V2 implements IController {
    
     private TableroSudoku9x9V2 tab;   
     public static int [][] matriz = new int[9][9]; 
     TableroInicial9x9 tI;
     SolucionTablero9x9 sol= new SolucionTablero9x9();
     private NivelYTamanio nyt;
     TableroController x;
     static Cronometro c;
    public void process(String model){   
   
    //CRONOMETRO QUE CONTROLA LA PARTIDA
   c=new Cronometro();
   c.setLocation(900, 600); 
   c.iniciarCronometro();
  
   
   if (x.nivel.equals("Nivel 1")){
       tI=new TableroInicial9x9(matriz);
       matriz=tI.generarTablero(20);      
          
    }else if(x.nivel.equals("Nivel 2")){ 
               
            tI=new TableroInicial9x9(matriz);
            matriz=tI.generarTablero(20);
           
              
    }else if(x.nivel.equals("Nivel 3")){ 
              
        tI=new TableroInicial9x9(matriz);
        matriz=tI.generarTablero(20);
            
        
    }
    int p=0;
       for (int x=0; x < matriz.length; x++) {
                for (int y=0; y < matriz[x].length; y++) {
                     int z= matriz[x][y];
                    if (z!=0){                      
                     tab.text1[p].setEditable(false);
                     tab.text1[p].setText(String.valueOf(matriz[x][y]));                
                    }
                    else{
                        tab.text1[p].setText("");
                        tab.text1[p].setEditable(true);
                    }
                    p++;
    }
       }
    }
    
    
   

     
    public void setView(IView x) {
       this.tab = (TableroSudoku9x9V2) x;             
}
}